import Vue from 'vue'

// 本地缓存
import Storage from 'vue-ls'
const options = {
  namespace: 'ws_', // key prefix
  name: 'ls', // name variable Vue.[ls] or this.[$ls],
  storage: 'local' // storage name session, local, memory
}
Vue.use(Storage, options)

// 权限
import PermissionHelper from '@/utils/helper/permission'
Vue.use(PermissionHelper)

// md5
import md5 from 'js-md5'
Vue.prototype.$md5 = md5

/**
 * 使用mock.js
 * 生成环境必须禁止
 */
if (process.env.NODE_ENV !== 'production') {
  const { mockXHR } = require('../../mock')
  mockXHR()
}

// 图片预览
import 'viewerjs/dist/viewer.css'
import Viewer from 'v-viewer'
Vue.use(Viewer)
Viewer.setDefaults({
  zIndexInline: 2017
})
